package com.ruben.features;

import java.util.*;

/**
 * of 案例
 *
 * @author <achao1441470436@gmail.com>
 * @since 2021/7/18 18:40
 */
public class OfDemo {
    public static void main(String[] args) {
        List<Integer> list = List.of(1, 2, 3, 4, 5, 6);
        Set<Integer> sets = Set.of(1, 2, 3, 4, 5, 6);
        Map<Integer, Integer> maps = Map.of(1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6);
        Map<Integer, Integer> entries = Map.ofEntries(Map.entry(1, 1),
                Map.entry(2, 2),
                Map.entry(3, 3),
                Map.entry(4, 4),
                Map.entry(5, 5),
                Map.entry(6, 6));
        Collections.unmodifiableCollection(Arrays.asList(""));
        Collections.unmodifiableList(Collections.singletonList(""));
        Collections.unmodifiableMap(new HashMap<>(1 << 4));
        Collections.unmodifiableSet(new HashSet<>());
        Collections.unmodifiableNavigableMap(new TreeMap<>());
        Collections.unmodifiableNavigableSet(new TreeSet<>());
        Collections.unmodifiableSortedMap(new TreeMap<>());
        Collections.unmodifiableSortedSet(new TreeSet<>());
    }

}
